package com.example.framework;

import java.io.IOException;
import java.util.Properties;

public class HelperManager {
    private Properties properties;
    private ContactHelper contactHelper;
    private ProcessHelper processHelper;
    private AutoItHelper autoItHelper;

    public HelperManager(Properties properties) throws IOException {
        this.properties = properties;
        start();
    }

    public void start() throws IOException {
        getProcessHelper().startApplication();
    }

    public void stop(){
        getProcessHelper().stopApplication();
    }

    public String getProperty(String key) {
        return properties.getProperty(key);
    }

    public ContactHelper getContactHelper() {
        if (contactHelper == null){
            contactHelper = new ContactHelper(this);
        }
        return contactHelper;
    }

    public ProcessHelper getProcessHelper() {
        if (processHelper == null){
            processHelper = new ProcessHelper(this);
        }
        return processHelper;
    }

    public AutoItHelper getAutoItHelper() {
        if (autoItHelper == null){
            autoItHelper = new AutoItHelper(this);
        }
        return autoItHelper;
    }
}

